﻿@{
    ViewBag.Title = "我的积分";
    Layout = "~/Views/Shared/_LayoutFore.cshtml";
}
 
<div class="RightContrent">
    <div style="margin-left: 50px; margin-right: 50px;">
        <div class="tab-content">
            <div class="line10"></div>
            <div class="line10"></div>
            <div class="tab_title">@ViewBag.Title</div>
            <div class="tab-content">
                <div style="width: 16px; height: 12px; float: left;">
                    <img src="~/Content/Images/leftarraw.png" />
                </div>
            </div>

            <div class="tab-content_border">

                <div class="u-center">
                    <div class="menu-list" align="left">
                        可兑换积分：<a  style="font-size: 20px; color: #d44e00" >@ViewBag.scoreCount</a> 分
                        <a id="ScoreRules" href="#">[点击查看积分规则]</a>
                    </div> 
                    <div class="line20"></div> 
                     
                    <div id="gridlist" class="xjgrid">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var util = {};
    var options = {
        listUrl: "@Url.Action("MyScore")"
        };

        $(document).ready(function () {
            var gridopt = {
                url: options.listUrl,
                colModel: [
                { display: '编号', name: 'Id', width: "5%", sortable: true, hide: true, align: 'left', iskey: true },
                { display: '日期', name: 'CreateTime', width: "20%", sortable: false, hide: false, align: 'left' },
                { display: '类型', name: 'Type', width: "10%", sortable: false, align: 'left', process: fromatType },
                { display: '项目说明', name: 'Remark', width: "10%", sortable: false, align: 'left' },
                { display: '积分变化', name: 'Total', width: "10%", sortable: false, align: 'center' }  
                 
                ],
                sortname: "Id",
                sortorder: "DESC",
                title: false,
                rp: 14,
                usepager: true,
                showcheckbox: false
            };
            var xjgrid = new xjGrid("gridlist", gridopt);

            function fromatType(value, cell) {
                var ops = [];
                if (value == '1') {
                    ops.push("消费");
                } else {
                    ops.push("获取");
                }
                return ops.join("");
            }  
            $("#formWithdrawTime").submit(function () {
                xjgrid.Query(this);
                return false;
            });

            $("#ScoreRules").click(function () {
                $.dialog({
                    id: 'rules',
                    lock: true,
                    fixed: true,
                    esc: false,
                    min: false,
                    max: false,
                    resize: false,
                    background: '#000', /* 背景色 */
                    opacity: 0.5,       /* 透明度 */
                    width: 700,
                    height: 520,
                    content: '积分规则',
                    title: '积分规则'
                });
            })
        });
  
</script>


